package com.bw.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bw.dao.ResourceMapper;
import com.bw.entity.Resource;
import com.bw.service.ResourceService;

@Service(value = "resourceService")
public class ResourceServiceImpl implements ResourceService {

    @Autowired
    private ResourceMapper<Resource>resourceMapper;
    
    @Override
    public Integer insertSelective(Resource resource) throws Exception {
           return this.resourceMapper.insertSelective(resource);
        }

    @Override
    public Integer insertBatch(List<Resource> resource) throws Exception {
           return this.resourceMapper.insertBatch(resource) ;
        }

    @Override
    public Integer deleteByPrimaryKey(Object id) {
            return this.resourceMapper.deleteByPrimaryKey(id);
    }

    public Integer deleteBatchByPrimaryKey(List<Object> ids) {
           return this.resourceMapper.deleteBatchByPrimaryKey(ids);
    }

    @Override
    public Integer updateByPrimaryKeySelective(Resource resource) {
           return this.resourceMapper.updateByPrimaryKeySelective(resource);
    }

    @Override
    public Resource findById(Object id) {
           return (Resource) this.resourceMapper.selectByPrimaryKey(id);
    }

    @Override
    public List<Resource> selectByCondition(Resource resource) {
           return (List<Resource>) this.resourceMapper.selectByCondition(resource);
    }

    @Override
    public Integer selectCountByCondition(Resource resource) {
           return  this.resourceMapper.selectCountByCondition(resource);
    }

}
